<extend name="Layout:layout_form" />
<block name="body_main">
    <taglib name="Common\TagLib\Sohtml"/>    
    <form action="{:AddonU('document_edit_save')}" method="post" class="xsui-form" enctype="multipart/form-data" style="min-width:800px;">
        <fieldset>
            <div class="xsui-form-field">
                <label>标题：</label>
                <input type="text" name="title" placeholder="标题" value="{$data.title}" title="{$data.title}" size="90" required="required" />
            </div>
            <div class="xsui-form-field">
                <label>类别：</label>
                <select name="category_id" data-url="{:AddonU('Channels/get_channel_tree_json','type_id=2')}" data-value="{$data.category_id}"></select>
                <label>来源：</label>
                <input type="text" name="source" value="{$data.source}" placeholder="来源" size="59" />
            </div>
            <div class="xsui-form-field">
                <label>图片：</label>
                <sohtml:file name="picture_url" value="{$data.picture_url}" />
            </div>
            <div class="xsui-form-field-vertical">
                <label>摘要内容：</label>
                <textarea name="summary" placeholder="摘要内容" required="required" cols="90" rows="3" style="width:95%">{$data.summary}</textarea>
            </div>
            <div class="xsui-form-field-vertical">
                <label>正文内容：</label>
                <textarea name="content" class="editor" cols="90" rows="18" style="width:99%">{$data.content}</textarea>
            </div>
            <div class="xsui-form-field">
                <label>发布时间：</label>
                <input type="text" name="create_time" value="{$data.create_time|default=date('Y-m-d H:i:s')}" placeholder="发布时间" class="datetimepicker" />
                <label>状态：</label>
                <sohtml:radio name="status" items="1=显示;0=隐藏" value="{$data.status}" required="required" />
            </div>
        </fieldset>
        <button type="submit" class="xsui-hidden">提交</button>
        <input type='hidden' name='id' value='{$data.id}'/>
    </form>
</block>
<block name="body_after">
    <script>
        $(function () {
            ajax_combobox({selector: 'select[name="category_id"]', def_option: '请选择类别'});
        })
    </script>
</block>